<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/11/23
  Time: 23:30
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>上传头像</title>
    <%
        pageContext.setAttribute("APP_PATH", request.getContextPath());
    %>
</head>
<body>
<div class="container">
    <!-- <button type="button" class="btn btn-primary" data-toggle="modal"
        data-target="#userPhoto">按钮</button> -->

    <div class="modal fade" id="userPhoto" tabindex="-1" role="dialog"
         aria-labelledby="exampleModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content col-md-6 col-md-offset-3">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"
                            aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <h3 class="modal-title text-center" id="exampleModalLabel">上传你的头像</h3>
                    <p class="text-center">听说，带有个性的头像很有趣</p>
                </div>
                <div class="modal-body">
                    <form action="${APP_PATH }/viaController/setUserPhoto.do" method="post" enctype="multipart/form-data">
                        <p class="text-muted">在本地选择你的头像：</p>
                        <div class="form-group">
                            <div id="user_preview">
                                <a href="#">
                                    <img class="img-thumbnail" style="position: relative; width: 100%; height: 100%;"
                                         id="user_imghead" src="${APP_PATH }/static/img/fatiePhoto.png"
                                         onclick="$('#user_previewImg').click();">
                                </a>
                            </div>
                            <input type="file" onchange="user_previewImage(this)"
                                   style="display: none;" id="user_previewImg" name="photo">
                        </div>

                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">返回</button>
                            <button type="submit" class="btn btn-primary">保存</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="${APP_PATH }/static/js/images_photo.js"></script>
</body>
</html>
